FunkyMonkey
Aspiring developer
Profile
Posts: 1177
Reg: Aug 07, 2013
blackpool
14,570
07/28/16 12:31 AM (7 years ago)

Ios One signal compiling probs

Hi guys, having problem integrating one signal into IOS, Have followed alans guide, Its something im doing wrong, its in the last step, when adding the code to the .m file, As soon as i add the code, i get 10 red errors and cant compile. what i have noticed is in the framework folder, there are 2 files in red (these arnt coming up as errors, just the file is in red) libsqlite3.dylib (in the SystemConfiguration.framework) and XCTest.framework (in the UIKit.framework) could any of these be doing it. cheers Sean
 
miku
Aspiring developer
Profile
Posts: 405
Reg: Feb 20, 2014
zagorje ob savi
10,600
like
07/28/16 12:56 AM (7 years ago)
I have on all iOS apps with OneSignal these 2 files red, but it works fine. You maybe made mistake somewhere else.
 
FunkyMonkey
Aspiring developer
Profile
Posts: 1177
Reg: Aug 07, 2013
blackpool
14,570
like
07/28/16 12:59 AM (7 years ago)
ok thats helps, thanks dude, its only after i add the code to the.m file that all the errors show, everthing else add fine and runs without error, this is the code im adding , can anyone notice anything im doing wrong, this is what the .m file looks like after adding the code //didFinishLaunchingWithOptions... -( BOOL )application:( UIApplication *)application didFinishLaunchingWithOptions:( NSDictionary *)launchOptions{ [ BT_debugger showIt : self message :[ NSString stringWithFormat : @"didFinishLaunchingWithOptions%@" , @"" ]]; /* ajm below added to support onesignal */ self.oneSignal = [[OneSignal alloc] initWithLaunchOptions:launchOptions appId:@"79f8d012-4001-4484-84bc-f7847ae9fa8c" handleNotification:^(NSString* message, NSDicti onary* additionalData, BOOL isActive) { // This function gets called when a notificatio n is received while the app is in focus. // code based on the example provided with SDK AudioServicesPlaySystemSound(1007 ); // play system sound, see http://iphonedevwi ki.net/index.php/AudioServices AudioServicesPlaySystemSound(kSystemSoundID _Vibrate); // vibrate NSString* messageTitle = @"Alert"; NSString* fullMessage = [message copy]; if (additionalData) { NSLog(@"additionalData: %@", additional Data); NSString* customKey = additionalData[@" customKey"]; if (customKey) NSLog(@"customKey: %@", customKey); if (additionalData[@"inAppTitle"]) messageTitle = additionalData[@"inA ppTitle"]; if (additionalData[@"actionSelected"]) fullMessage = [fullMessage stringBy AppendingString:[NSString stringWithFormat:@"\nPres sed ButtonId:%@", additionalData[@"actionSelected"]]]; } UIAlertView* alertView = [[UIAlertView allo c] initWithTitle:messageTitle message:fullMessage delegate:self c ancelButtonTitle:@"Close" o therButtonTitles:nil, nil]; [alertView show]; // show the alert as a po p-up // Check for and read any custom values you added to the notification // This done with the "Additional Data" sec tion the dashboard OR setting the 'data' field on o ur REST API. }];
 
miku
Aspiring developer
Profile
Posts: 405
Reg: Feb 20, 2014
zagorje ob savi
10,600
like
07/28/16 01:28 AM (7 years ago)
This is script that works for me: /* ajm below added to support onesignal */ self.oneSignal = [[OneSignal alloc] initWithLaunchOptions:launchOptions appId:@"INSERT YOUR" handleNotification:^(NSString* message, NSDictionary* additionalData, BOOL isActive) { // This function gets called when a notification is received while the app is in focus. // code based on the example provided with SDK AudioServicesPlaySystemSound(1007 ); // play system sound, see http://iphonedevwiki.net/index.php/AudioServices AudioServicesPlaySystemSound(kSystemSoundID_Vibrate); // vibrate NSString* messageTitle = @"Alert"; NSString* fullMessage = [message copy]; if (additionalData) { NSLog(@"additionalData: %@", additionalData); NSString* customKey = additionalData[@"customKey"]; if (customKey) NSLog(@"customKey: %@", customKey); if (additionalData[@"inAppTitle"]) messageTitle = additionalData[@"inAppTitle"]; if (additionalData[@"actionSelected"]) fullMessage = [fullMessage stringByAppendingString:[NSString stringWithFormat:@"\nPressed ButtonId:%@", additionalData[@"actionSelected"]]]; } UIAlertView* alertView = [[UIAlertView alloc] initWithTitle:messageTitle message:fullMessage delegate:self cancelButtonTitle:@"Close" otherButtonTitles:nil, nil]; [alertView show]; // show the alert as a pop-up // Check for and read any custom values you added to the notification // This done with the "Additional Data" section the dashboard OR setting the 'data' field on our REST API. }]; /* ajm above added to support onesignal */ -------------- Of course, you must change appid.
 
FunkyMonkey
Aspiring developer
Profile
Posts: 1177
Reg: Aug 07, 2013
blackpool
14,570
like
07/28/16 01:47 AM (7 years ago)
Miku, I think i love you little bit lol, That fixed everything, send test push through one signal and it all worked hurray :) thanks bunch dude been on this for week Sean
 
miku
Aspiring developer
Profile
Posts: 405
Reg: Feb 20, 2014
zagorje ob savi
10,600
like
07/28/16 09:40 AM (7 years ago)
OK. Looks that nobody uses OneSignal in Android Studio? I asked here https://www.buzztouch.com/forum/thread.php?fid=CBDC673DFA8F87729559015&tid=CBDC673DFA8F87729559015 but no answer. I still think that OneSignal is best solution for BT users.
 
FunkyMonkey
Aspiring developer
Profile
Posts: 1177
Reg: Aug 07, 2013
blackpool
14,570
like
07/29/16 09:13 AM (7 years ago)
Im gonna try one signal for android over the weekend, I will let you know how it goes, I already have Android push working from Buzztouch, but i need to have push sent from one account if poss. Cheers Sean
 
AlanMac
Aspiring developer
Profile
Posts: 2612
Reg: Mar 05, 2012
Esher, UK
37,120
like
07/30/16 12:27 PM (7 years ago)
I think the code you used was basically OK, but somehow a couple of carriage returns crept in when you copied from the pdf guide and pasted into xcode. It looks that caused the errors. Alan
 
miku
Aspiring developer
Profile
Posts: 405
Reg: Feb 20, 2014
zagorje ob savi
10,600
like
08/03/16 07:11 AM (7 years ago)
Did you try OneSignal for Android yet?
 
FunkyMonkey
Aspiring developer
Profile
Posts: 1177
Reg: Aug 07, 2013
blackpool
14,570
like
08/03/16 07:57 AM (7 years ago)
I did but stopped as i couldn't get it to work, It messed up my google play settings as well lol
 

Login + Screen Name Required to Post

pointerLogin to participate so you can start earning points. Once you're logged in (and have a screen name entered in your profile), you can subscribe to topics, follow users, and start learning how to make apps like the pros.